import VueRouter from 'vue-router'


//导入路由组件
import HomeContainer from "./components/tabbar/HomeContainer.vue"
import MemberContainer from "./components/tabbar/MemberContainer.vue"
import SearchContainer from "./components/tabbar/SearchContainer.vue"
import ShopcarContainer from "./components/tabbar/ShopcarContainer.vue"
import NewsList from "./components/news/NewsList.vue"
import NewsInfo from "./components/news/NewsInfo.vue"
import PhotoList from "./components/phptos/PhotoList.vue"
import PhotoInfo from "./components/phptos/PhotoInfo.vue"
import GoodsList from "./components/goods/GoodsList.vue"
import GoodsInfo from "./components/goods/GoodsInfo.vue"
import goodsDesc from "./components/goods/goodsDesc.vue"
import GoodsComments from "./components/goods/GoodsComment.vue"

const router= new VueRouter({
    routes:[
        {path:"/",redirect:"/home"},
        {path:"/home",component:HomeContainer},
        {path:"/member",component:MemberContainer},
        {path:"/search",component:SearchContainer},
        {path:"/shopcar",component:ShopcarContainer},
        {path:"/home/newslist",component:NewsList},
        {path:"/home/newsinfo/:id",component:NewsInfo,props:true},
        {path:"/home/photolist",component:PhotoList},
        {path:"/home/photoinfo/:id",component:PhotoInfo,props:true},
        {path:"/home/goodslist",component:GoodsList},
        {path:"/home/goodsinfo/:id",component:GoodsInfo,props:true},
        {path:"/home/goodsdesc/:id",component:goodsDesc,props:true},
        {path:"/home/goodscomments/:id",component:GoodsComments,props:true,name:"goodscomments"}
    ],
    linkActiveClass:'mui-active' //手动设置被激活的路由链接的高亮类名
})


// 把路由对象暴露出去
export default router